package Stringdemo;

public class Stringdemobuilder {
    public static void main(String[] args){
        StringBuilder sb = new StringBuilder("abc");
        //java写好了的类，打印sb(属性值)为空，不是地址值,在new里面添加就可以解决
        sb.append(1);//向sb中添加字符
        sb.append(5.6);
        System.out.println(sb);//abc15.6
        sb.reverse();//字符反转
        System.out.println(sb);//6.51cba
        String str = sb.toString();//将sb提取为字符串
        System.out.println(str);//6.51cba




    }
}
